home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadcom / sample / mc.doc < prev    next >
Encoding:
Text File  |  1995-02-08  |  4.5 KB  |  119 lines

  1.                         AutoCAD Menu Compiler
  2.  
  3.                          by Kelvin R. Throop
  4.                     Revision 2 --  October 22, 1985
  5.  
  6. The AutoCAD menu compiler makes the previously tedious and error prone
  7. task of constructing tablet menus merely boring and unforgiving.  It
  8. eliminates the need to duplicate text in many locations when using
  9. "large boxes" on a tablet, and removes the need to count lines by hand
  10. when placing information in a menu file.  In addition, a powerful
  11. macro facility is provided which allows commonly used substrings to be
  12. expanded automatically.  This facility makes configurable menus
  13. possible and reduces retyping.  The output of the menu compiler is a
  14. .MNU file compatible with AutoCAD 2.0 and up.
  15.  
  16. USING THE MENU COMPILER
  17.  
  18. The menu compiler is invoked with the command:
  19.  
  20.     MC <file> [options]
  21.  
  22. where <file> is the name of the menu definition file to be processed,
  23. specified without the file type.  The input menu definition file
  24. should have a file type of ".MND", and the output menu will be written
  25. with file type ".MNU", overwriting any previous file with this name.
  26. Options are specified as "-<letter>", and are as follows:
  27.  
  28.     -D     Dump macro definitions
  29.     -I     List input
  30.     -M     Disable macro facility
  31.     -?     Print a help message
  32.  
  33. THE MENU DEFINITION FILE
  34.  
  35. An AutoCAD menu is composed of sections, such as "TABLET1", "BUTTONS",
  36. and "SCREEN", and user-defined submenus.  The menu definition file is
  37. a compact form of specifying a menu file.  If none of the features
  38. provided by the menu compiler are used, the output file will be
  39. identical to the input.
  40.  
  41. There are two major features offered by the menu compiler: multiple
  42. line items and macros.  These features are completely separate and
  43. will be discussed separately.
  44.  
  45. Multiple Line Items
  46.  
  47. In a tablet menu, large boxes are frequently used to invoke commonly
  48. used commands.  A large box is actually made of up several smaller
  49. boxes.  AutoCAD doesn't "know" about this large box as a separate
  50. item--the large box is implemented simply by duplicating the menu
  51. command text in each of the smaller boxes which make up the large box.
  52. Before the menu compiler, this meant placing the command lines in
  53. multiple places in the file, counting lines from the start of the
  54. section by hand.  Now you can say:
  55.  
  56.     <number,number,...>Command
  57.  
  58. and the "Command" will be placed automatically at the specified lines
  59. in the file.  For example, if the REDRAW command is to be placed in
  60. boxes 20, 21, 22, 98, 99, 100, 141, 142, 143 in the menu, you would
  61. say:
  62.  
  63.     <20,21,22,98,99,100,141,142,143>REDRAW
  64.  
  65. and the menu compiler will automatically place REDRAW on each of the
  66. specified lines of the section.  You may use regular commands within
  67. one section (for a screen menu, say), and multiple line commands
  68. within another.  Mixing command types within a section is probably an
  69. error and will generate a diagnostic from the menu compiler.  To place
  70. text on a single line, just specify one number before it:
  71.  
  72.     <33>QUIT
  73.  
  74. Macros
  75.  
  76. The menu compiler allows commonly used text to be stored in macros and
  77. inserted by name at any place within the menu.  To define a macro, use
  78. a command of the form:
  79.  
  80.     {macname}=text
  81.  
  82. where "macname" is the name of the macro (1 to 31 characters, case
  83. insensitive) and "text" is the text value of the macro.  The macro
  84. definition must start in column 1 of the line.  A macro may be invoked
  85. anywhere within the text just by naming it within braces.  For
  86. example, if you have defined:
  87.  
  88.     {animal1}=cat
  89.     {animal2}=rat
  90.  
  91. the text line:
  92.  
  93.     <12,35>The {animal1} saw the {animal2}.
  94.  
  95. will place the command "The cat saw the rat." on lines 12 and 35 of
  96. the section.
  97.  
  98. A macro definition cannot span more than one line.  Maximum line length
  99. is 132 characters.
  100.  
  101. Macros may be used recursively.  For example, you may define:
  102.  
  103.     {default}=LAYER SET 0  COLOR BYLAYER LINETYPE SET BYLAYER  SNAP .25
  104.     {reset}=ZOOM A {default} GRID ON
  105.  
  106. and then say:
  107.  
  108.     <1,2,13,14>{reset} SAVE
  109.  
  110. If you create an infinite recursion loop, the menu compiler will give
  111. up after the menu item grows to more than 900 characters, issue a
  112. diagnostic, and replace the offending line in the output menu with a
  113. line which indicates which macro was being evaluated when the cow fell
  114. through the roof.
  115.  
  116. If you have information within braces and don't want the macro
  117. expansion to process it, you may disable macro expansion altogether by
  118. setting the -M switch on the command line.
  119.